﻿using System;

namespace GameOfLife {

    /// <summary>
    /// A Runner strategy returning the Console solution
    /// </summary>
    class StepConsoleRunStrategy : IRunStrategy {

        public void Runner(int size) {
            Game GoL = new Game(size);
            int run = 1;
            while (true) {
                Console.WriteLine("Run: " + run + "\t(press ANY KEY to iterate, ESC to quit)");
                Console.WriteLine("-------------------------------------------------");
                run++;

                GoL.draw();
                GoL.NextDay();
                ConsoleKeyInfo info = Console.ReadKey();
                if (info.Key == ConsoleKey.Escape) break;
                System.Threading.Thread.Sleep(100);
                Console.Clear();
            }
        }
    }
}
